<template>
    <div class="app-less">
        <h2>{{title}}</h2>
        
        <video width="640" :src="videourl" height="450" controls>
      
        </video>
    </div>
</template>

<style scoped>
.app-less{
    width: 1100px;
    height: 550px;
    margin: 20px auto;
    padding: 30px;
    background-color: #fff;
}
</style>
<script setup>
import {getLessonDetail} from '@/apis/course'
import { onMounted,ref } from 'vue'
import {useRoute} from 'vue-router'
const route = useRoute()

const title = ref('')
const videourl = ref('')

const getLesson = async()=>{
    const res = await getLessonDetail(route.params.id)
    title.value = res.data.title

    videourl.value = res.data.videoUrl
    console.log(videourl.value)

}

onMounted(()=>{
    getLesson()
})
</script>